﻿/*
 * Jonathan.Tests
 * Created by: Jonathan Montiverdi
 * Date: 6/13/2012
 * License: http://jonathan.codeplex.com/license
 */
using System;
using Jonathan.Data;
using Jonathan.Logic;
using Jonathan.Tests.Logic;
using Monti.MVVM.Services;
using NUnit.Framework;

namespace Jonathan.Tests.Data
{
   /// <summary>
   /// Tests the options object in Jonathan.
   /// </summary>
   [TestFixture]
   public class TestOptions
   {
      /// <summary>
      /// Sets up the test fixture.
      /// </summary>
      [TestFixtureSetUp]
      public void TestFixtureSetup ()
      {
         ServiceManager.RegisterSingleton <IMain, MainMock> ();
      }
      
      /// <summary>
      /// Cleans up the test fixture.
      /// </summary>
      [TestFixtureTearDown]
      public void TestFixtureTearDown ()
      {
         var main = ServiceManager.Resolve <IMain> ();
         main.Dispose ();
         ServiceManager.RemoveAllServices ();
      }
      
      /// <summary>
      /// Tests to verify that the book collection is not
      /// null when a new options object is created.
      /// </summary>
      [Test]
      public void TestBooksNotNull ()
      {
         var options = new Options ();
         Assert.IsNotNull (options.Books);
      }
      
      /// <summary>
      /// Tests to verify that the main interface is not
      /// null when a new options object is created.
      /// </summary>
      [Test]
      public void TestMainNotNull ()
      {
         var options = new Options ();
         Assert.IsNotNull (options.Main);
      }
   }
}
